﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using IService.Data;
using IService.Model;
using IService.DataDLL;

namespace IService.Business.Manager
{
    public class ProductsManager
    {
        public DataTable GetProductsListAll()
        {
            return DTVData.ProductsManager.GetProductsListAll(typeof(Products));
        }

        public DataTable GetLatestProductsList(int productsnum)
        {
            return DTVData.ProductsManager.GetLatestProductsList(typeof(Products), productsnum);
        }

        public DataTable GetProductsListPagin(PagingEntity pe)
        {
            return DTVData.ProductsManager.GetProductsListPagin(typeof(Products), pe);
        }

        public Products GetProductsById(int Id)
        {
            Products Products = new Products();
            Products.ID = Id;
            return DTVData.ProductsManager.GetProductsById(Products);
        }
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="Products"></param>
        /// <returns></returns>
        public bool InsertProducts(Products products)
        {
            return DTVData.ProductsManager.InsertProducts(products);
        }

        public bool UpdateProducts(Products products)
        {
            return DTVData.ProductsManager.UpdateProducts(products);
        }

        public bool DeleteProducts(int Id)
        {
            Products Products = new Products();
            Products.ID = Id;
            return DTVData.ProductsManager.DeleteProducts(Products);
        }

        public bool DeleteProductsByIds(string Ids)
        {
            return DTVData.ProductsManager.DeleteProductsByIds(typeof(Products), Ids);
        }
    }
}
